package org.hao.samples.dao;

import org.hao.samples.model.Role;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
@Transactional
public class RoleHibernateDAO extends BaseHibernateDAO<Role> implements IRoleDAO {

	@Override
	public Role findRoleById(Integer id) {
		return this.get(id);
	}

	@Override
	public void deleteRole(Integer id) {
		Role role = this.get(id);
		if (role != null) {
			this.delete(role);
		}
	}

	@Override
	public void createRole(Role entity) {
		this.save(entity);
	}

}
